package com.zqu.controller;

import com.zqu.pojo.AdditionalProductOrder;
import com.zqu.service.AdditionalProductOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("additionalproductorder")
public class AdditionalProductOrderController {

    @Autowired
    private AdditionalProductOrderService additionalProductOrderService;

    @RequestMapping("findadditionalproductorder")
    @ResponseBody
    public AdditionalProductOrder selectById(){
        return additionalProductOrderService.selectAdditionalProductOrderById(1);
    }

    @RequestMapping("selectlist")
    @ResponseBody
    public List<AdditionalProductOrder> selectlist(){
        return additionalProductOrderService.selectList(new AdditionalProductOrder());
    }

    @RequestMapping("insertadditionalproductorder")
    @ResponseBody
    public boolean insert(){
        return additionalProductOrderService.insertAdditionalProductOrder(new AdditionalProductOrder());
    }

    @RequestMapping("updateadditionalproductorder")
    @ResponseBody
    public boolean update(){
        return additionalProductOrderService.updateAdditionalProductOrder(new AdditionalProductOrder());
    }

    @RequestMapping("deleteadditionalproductorder")
    @ResponseBody
    public boolean delete(){
        return additionalProductOrderService.deleteAdditionalProductOrder(1);
    }

    @RequestMapping("deleteadditionalproductorderbyids")
    @ResponseBody
    public boolean deletebyids(){
        String[] ids = {"1","2"};
        return additionalProductOrderService.deleteAdditionalProductOrderByIds(ids);
    }
}
